var cc__decorate = __decorate;
Object.defineProperty(exports, "__esModule", {
  value: true
});
var cc__decorator = cc._decorator;
var ccp_ccclass = cc__decorator.ccclass;
var ccp_property = cc__decorator.property;
var def_gezi_2 = /* */function (_cc$Component) {
  function _ctor() {
    var _this2;
    babel_classCallCheck(this, _ctor);
    _this2 = _callSuper(this, _ctor, arguments);
    _this2.need_PNG2 = true;
    _this2.need_ANI = true;
    _this2.png1 = null;
    _this2.png2 = null;
    _this2.bsSpfs = [];
    _this2.startPos = cc.v2(0, 0);
    _this2.id = -1;
    _this2.color = -1;
    _this2.isNeedDelete = false;
    return _this2;
  }
  babel_inherits(_ctor, _cc$Component);
  return babel_createClass(_ctor, [{
    key: "setColor",
    value: function setColor(t) {
      this.png1.spriteFrame = this.bsSpfs[t];
      if (this.need_PNG2) {
        this.png2.node.active = true;
        this.png2.spriteFrame = this.bsSpfs[t + 6];
      } else {
        this.png2.node.active = false;
      }
      this.color = t;
      this.setStartPos();
      var e = this.node.getChildByName("baoshi");
      var i = 5 * this.id + 900;
      var s = this.id / 100 + .6 * Math.random() + .6;
      e.y = -i;
      cc.tween(e).to(s, {
        y: -40
      }).to(.3, {
        y: 0
      }).start();
    }
  }, {
    key: "setStartPos",
    value: function setStartPos() {
      this.startPos = this.node.getPosition();
    }
  }, {
    key: "guiwei",
    value: function guiwei() {
      this.node.setPosition(this.startPos);
    }
  }, {
    key: "guiwei2",
    value: function guiwei2() {
      var t = cc.moveTo(.1, this.startPos);
      this.node.runAction(t);
    }
  }, {
    key: "xiaoshi",
    value: function xiaoshi() {
      var _this3 = this;
      this.need_ANI && this.node.getComponent(cc.Animation).play();
      cc.tween(this.node).by(.3, {
        y: 20
      }).by(.6, {
        y: -700
      }).call(function () {
        cc.isValid(_this3.node) && _this3.node.destroy();
      }).start();
    }
  }, {
    key: "ischoose",
    value: function ischoose(t) {
      this.node.getChildByName("choose").active = t;
    }
  }]);
}(cc.Component);
cc__decorate([ccp_property()], def_gezi_2.prototype, "need_PNG2", undefined);
cc__decorate([ccp_property()], def_gezi_2.prototype, "need_ANI", undefined);
cc__decorate([ccp_property(cc.Sprite)], def_gezi_2.prototype, "png1", undefined);
cc__decorate([ccp_property(cc.Sprite)], def_gezi_2.prototype, "png2", undefined);
cc__decorate([ccp_property(Array(cc.SpriteFrame))], def_gezi_2.prototype, "bsSpfs", undefined);
def_gezi_2 = cc__decorate([ccp_ccclass], def_gezi_2);
exports.default = def_gezi_2;